package HomeWork.Work_02;

import java.util.Scanner;

/**
 * 声明一个年份变量，判断这个年份是否是闰年。
 */
public class Date {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入年份：");
        int year = sc.nextInt();
        boolean flag = date(year);
        if(flag){
            System.out.println("这一年是闰年！");
        }else{
            System.out.println("这一年是平年！");
        }
    }
    public static boolean date(int year){
        return (0 == year % 4 && year % 100 != 0) || 0 == year % 400;
    }
}
